<?php
/**
 * Created by PhpStorm.
 * User: Soha_Ros
 * Date: 17/6/2
 * Time: 上午1:37
 */

namespace ActionsHttp;

use Data\Food_DAO;
use Data\Food_groups_DAO;

class RestaurantFoodGetList extends BaseActionHttp
{
    public function doAction() {

        parent::doAction();

        $restaurant_id = $_SESSION[RESTAURANT_ID];
        $restaurant_id = 1;
        // 分类id
        $food_group_id = (int)$this->data[FOOD_GROUP_ID];
        if (!$food_group_id) {
            return $this->SendErrMsg("请选择分组id");
        }
        // 分类记录
        $food_group_record = Food_groups_DAO::getRecord($food_group_id);
        $food_order = $food_group_record->getFOOD_ORDER();
        // 获取商品列表
        $this->setValue(FOOD_ORDER,$food_order);
        $this->setValue(Food_list,Food_DAO::getArrayByRestaurantId($restaurant_id,$food_group_id));

        // 返回数据
        $this->ResponseDataToCurrentClient();

    }
}